async function createFetch(timeout) {
    return (resource,options)=>{
        const controller = new AbortController();
        options= options||{};
        options.signal =controller.signal;
        setTimeout(() => {
            controller.abort()
        }, timeout);
        return fetch(resource,options);
    }
}

createFetch(100,'http://baidu.com');
   